<!DOCTYPE html>
<html lang="id">
<head>
	<title>Sistem Administrasi Kontrak  PT. PP</title>
	<meta charset="utf-8">
	<meta content='id' http-equiv='Content-Language'/>
	<meta content='SSistem Administrasi Kontrak  PT. PP' name='description'/>
	<meta content='INDEX,NOFOLLOW' name='robots'/>
	<meta content='Sistem Monitoring Anggaran' name='keywords'/>
	<meta content='1 days' name='revisit-after'/>
	<meta content='1 days' name='revisit'/>
	<link href='#' rel='shortcut icon'/>

	<?php
		// ASSETS //;
		echo js_asset('jquery-1.8.3.min.js');

		echo css_asset('style.css');
		echo css_asset('file-upload.css');
		echo css_asset('heading.css');
		echo css_asset('color.css');
		echo css_asset('font.css');
		echo css_asset('align.css');
		echo css_asset('icon.css');
		
		/* theme */
		echo css_asset('960.css','theme/profiadmin');
		echo css_asset('reset.css','theme/profiadmin');
		echo css_asset('text.css','theme/profiadmin');
		echo css_asset('login.css','theme/profiadmin');
	?>
	
	<script>
	function login_process(){
		var l_username = $("#l_username").val();
		var l_password = $("#l_password").val();
		
		$.ajax({
			url :"<?php echo base_url('c_login/process')?>",
			type:"POST",
			dataType:"JSON",
			data:{
					l_username:l_username,
					l_password:l_password
				 },
			success:function(response){
				// console.log(response);
				if(response.message == "true"){
					window.location = "<?php echo base_url()?>"
				} else {
					alert_error.show("slow");
				}
			}
		});
	}

	$(document).ready(function(){
		alert_error = $(".error");
		alert_error.hide();
		
		$("#l_username").keypress(function(e){
			if(e.keyCode == 13){
				$("#l_password").focus();
			}
		});
		
		$("#l_password").keypress(function(e){
			if(e.keyCode == 13){
				login_process();
			}
		});
	});	
	</script>
</head>
<body>
<div class="container_16">
	<div class="grid_6 prefix_5 suffix_5">
        <center><img src="<?php echo base_url(); ?>../assets/images/logo.png" >
		<h3>Sistem Administrasi Kontrak  PT. PP - Form Login</h3></center>
		<div id="login">
		  <p class="error">Username dan password anda salah!</p>        
		  <div>
			<p>
			  <label><strong>Username</strong>
					<input type="text" name="textfield" class="inputText" id="l_username" />
			  </label>
		  </p>
			<p>
			  <label><strong>Password</strong>
				<input type="password" name="textfield2" class="inputText" id="l_password" />
			</label>
			</p>
			<a class="black_button" href="javascript:login_process()" ><span>Login</span></a>          
		  </div>
		  <br clear="all" />
		</div>
	</div>
</div>
<br clear="all" />
</body>
</html>
